﻿using IntelligentAgriculture.Contracts.Dto.Output.RidgepOutPut;
using IntelligentAgriculture.WebAPI.Application.Command.RidgepCpoamd;
using MediatR;
using IntelligentAgriculture.WebAPI.Application.Command.ColumnManageCommand;
using IntelligentAgriculture.Contracts.Dto.Output.ColumnManagementOutput;
using IntelligentAgriculture.Contracts.Interface.Iridgepletype;
using IntelligentAgriculture.WebAPI.Application.CommandHandler.ManageHandler;
using IntelligentAgriculture.Contracts.Interface.ColumnManagements;
using IntelligentAgriculture.Contracts.Dto.Output.PageOutput;

namespace IntelligentAgriculture.WebAPI.Application.CommandHandler.ColumnManageCommandHandler
{
    public class ColumnManageShowCommandHandler : IRequestHandler<ColumnManageShowCommand, Results<PagesOutput<ColumnShowOutput>>>
    {
        private readonly IColumnManageService _icolumnManageService;
        private readonly ILogger<ManageCommandHander> _logger;
        public ColumnManageShowCommandHandler(IColumnManageService icolumnManageService, ILogger<ManageCommandHander> logger)
        {
            _icolumnManageService = icolumnManageService;
            _logger = logger;
        }

        public async Task<Results<PagesOutput<ColumnShowOutput>>> Handle(ColumnManageShowCommand request, CancellationToken cancellationToken)
        {
            var list = _icolumnManageService.GetShow(request.Eitag);
            var results = Results<PagesOutput<ColumnShowOutput>>.DataResult(list);
            return results;
        }
    }
}
